package com.yyw.gulimall.authserver.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Pattern;

/**
 * @author 易煜玮
 * @ClassName RegisterUserVo.java
 * @Description 用户注册的VO类
 * @createTime 2020年12月14日 20:03:00
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class RegisterUserVo {
    private static final long serialVersionUID = 1L;
    /**
     * 用户名
     */
    @NotEmpty(message = "用户名不能为空")
    @Length(min = 3, max = 10, message = "用户名长度超出限制(3-10位)")
    private String username;
    /**
     * 密码
     */
    @NotEmpty(message = "请输入密码")
    @Length(min = 6, max = 12, message = "密码长度超出限制(6-12位)")
    private String password;
    /**
     * 确认密码
     */
    @NotEmpty(message = "确认密码不能为空")
    @Length(min = 6, max = 12, message = "密码长度超出限制(6-12位)")
    private String confirmPassWord;
    /**
     * 手机号
     */
    @NotEmpty(message = "请输入手机号")
    @Pattern(regexp = "^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(17[013678])|(18[0,5-9]))\\d{8}$", message = "请输入正确的手机号码")
    private String mobile;
    /**
     * 验证码
     */
    @NotEmpty(message = "请输入验证码")
    private String code;

}
